import {Component, ViewChild} from '@angular/core';
import {GnJsonFormComponent, GnModalContent} from 'geminis-ng';

@Component({
  selector: 'everydata-form',
  styleUrls: ['form-editor.component.less'],
  template: `
    <gn-json-form url="/everydata-pc/assets/forms/form/form.json" [dataId]="dataId"
                  [defaultValue]="{category:{id: categoryId}}"></gn-json-form>
  `
})
@GnModalContent({
  key: 'everydata-form',
  width: '80vw',
  height: '75vh',
  top: '30px'
})
export class FormEditorComponent {

  categoryId!: string;
  dataId!: string;

  @ViewChild(GnJsonFormComponent, {static: true}) form!: GnJsonFormComponent;

}
